package com.itouchtv.yang.core.tools;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import java.util.Objects;
import java.util.logging.Level;

public class Log {
    public static Logger logger;
    private Log(){
    }
    public static void init(){
        if (Objects.isNull(logger)){
            String path = ClassPath.getClassPath();
            LogManager.resetConfiguration();
            PropertyConfigurator.configure(path+"config/log4j.properties");
            Log.logger = Logger.getLogger("Test");
            java.util.logging.Logger.getLogger("").setLevel(Level.WARNING);
        }
    }
}
